/*
 * Lenovo Group
 * Copyright (c) 2015-2016 All Rights Reserved.
 * Project Name: lmrp-android app
 * Create Time: 16-2-16 下午6:39
 */

package com.lenovo.mso2o.entity;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by ligang on 2016/1/19.
 * Changed by zmd on 2106/2/2
 */
public class Order implements Serializable{
    private String itsmcode;		//工单系统标识
    private String ticketid;		//工单ID
    private String title;		//工单标题
    private String project;		//项目名称
    private String caddress;		//客户上门地址
    private Date cTime;		//创建时间
    private String position;		//经纬度,格式 经度：维度
    private OrderStatus status;
    private OrderShortcut shortcut;
    private double amount;
    private Date[] timers;
    private String priority; //优先级
    private String respondLevel;
    private String[] description;
    private Date overtime;    //完成时间
    private String evaluate;    //客户评价
    private String tickettype;  //工单类型
    private String appstatus;   //工单状态
    private int state; //快速关单

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public Date getOvertime() {
        return overtime;
    }

    public void setOvertime(Date overtime) {
        this.overtime = overtime;
    }

    public String getEvaluate() {
        return evaluate;
    }

    public void setEvaluate(String evaluate) {
        this.evaluate = evaluate;
    }

    public String getTickettype() {
        return tickettype;
    }

    public void setTickettype(String tickettype) {
        this.tickettype = tickettype;
    }

    public String getAppstatus() {
        return appstatus;
    }

    public void setAppstatus(String appstatus) {
        this.appstatus = appstatus;
    }



    public Order() {
        super();
    }

    public String getItsmcode() {
        return itsmcode;
    }

    public void setItsmcode(String itsmcode) {
        this.itsmcode = itsmcode;
    }

    public String getTicketid() {
        return ticketid;
    }

    public void setTicketid(String ticketid) {
        this.ticketid = ticketid;
    }

    public String getProject() {
        return project;
    }

    public void setProject(String project) {
        this.project = project;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getCaddress() {
        return caddress;
    }

    public void setCaddress(String caddress) {
        this.caddress = caddress;
    }

    public Date getcTime() {
        return cTime;
    }

    public void setcTime(Date cTime) {
        this.cTime = cTime;
    }

    public String getPosition() {
        return position;
    }

    public double getLatitude(){
        if(position != null && position.split(":").length == 2) {
            return Double.parseDouble(position.split(":")[1]);
        }else{
            return 0.0;
        }
    }

    public double getLongitude(){
        if(position != null && position.split(":").length == 2) {
            return Double.parseDouble(position.split(":")[0]);
        }else {
            return 0.0;
        }
    }

    public void setPosition(String position) {
        this.position = position;
    }


    public OrderShortcut getShortcut() {
        return shortcut;
    }

    public void setShortcut(OrderShortcut shortcut) {
        this.shortcut = shortcut;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public Date[] getTimers() {
        return timers;
    }

    public void setTimers(Date[] timers) {
        this.timers = timers;
    }

    @Override
    public String toString() {
        return "OrderListRes{" +
                "itsmcode='" + itsmcode + '\'' +
                ", ticketid='" + ticketid + '\'' +
                ", title='" + title + '\'' +
                ", project='" + project + '\'' +
                ", priority=" + priority +
                ", caddress='" + caddress + '\'' +
                ", cTime=" + cTime +
                ", position='" + position + '\'' +
                ", status=" + status +
                ", shortcut=" + shortcut +
                ", amount=" + amount +
                //", timers=" + Arrays.toString(timers) +
                '}';
    }

    public void setPriority(String priority) {
        this.priority = priority;
    }

    public String getPriority(){
        return this.priority;
    }

    public String getRespondLevel() {
        return respondLevel == null ? "" : respondLevel;
    }

    public void setRespondLevel(String respondLevel) {
        this.respondLevel = respondLevel;
    }

    public void setStatus(OrderStatus status) {
        this.status = status;
    }

    public OrderStatus getStatus(){
        return status;
    }

    public String[] getDescription() {
        return description;
    }

    public void setDescription(String[] description) {
        this.description = description;
    }
}
